<template>
    <div>
        <el-dialog title="详情" :visible.sync="dialogVisibles" width="45%" :before-close="handleClose" center="">
            <div class="top">
                <el-descriptions>
                    <el-descriptions-item label="提交人：">{{form.name}}</el-descriptions-item>
                    <el-descriptions-item label="维修地址：">{{form.address}}</el-descriptions-item>
                    <el-descriptions-item label="手机号">{{form.tel}}</el-descriptions-item>
                    <el-descriptions-item label="问题类型">
                        {{form.typename}}
                    </el-descriptions-item>
                    <el-descriptions-item label="问题描述">{{form.content}}</el-descriptions-item>
                </el-descriptions>
            </div>
            <div class="main">
                <el-image style="width: 50px; height: 50px;" v-for="item in form.images" :key="item.id"
                    :src="IMGURL+item.url" :preview-src-list="form.images.map((item)=>IMGURL+item.url)">
                </el-image>
            </div>
            <div>
                <el-steps :active="1" finish-status="success" simple style="margin-top: 20px">
                    <el-step title="步骤 1"></el-step>
                    <el-step title="步骤 2"></el-step>
                    <el-step title="步骤 3"></el-step>
                    <el-step title="步骤 4"></el-step>
                </el-steps>
            </div>
        </el-dialog>
    </div>
</template>

<script>
// 图片路径
import { IMGURL } from "@/api/config"
export default {
    name:"Details",
    props: {
        dialogVisibles: {
            type: Boolean,
            default: false
        },
        handleClickdata: {
            type: Object,
            default: () => { }
        },
    },
    data() {
        return {
            IMGURL: IMGURL,
            form: {
                images: []
            }
        }
    },
    updated() {
        this.form = this.handleClickdata

    },
    methods: {
        handleClose(done) {
            this.$confirm('确认关闭？')
                .then(_ => {
                    this.$emit('iscloses', false,)
                })
                .catch(_ => { });
        }
    },
    watch: {
        handleClickdata(val) {
            if (val) {
                for (let i in this.form) {
                    this.form[i] = val[i]
                    if (i == 'images') {
                        this.fileList = val[i]
                    }
                }
            }
        }
    }
}
</script>

<style lang="less" scoped>
.el-header,
.el-footer {
    color: #333;
    // text-align: center;
    // line-height: 60px;
    padding: 0 !important;
}

.el-main {
    // background-color: #E9EEF3;
    color: #333;
    text-align: center;
    line-height: 160px;
}
</style>